﻿
function UnitTest-Assert-Fail-Throws {
    Assert-Exception {
        Assert-Fail -Failure "Test" -Message "Expected failure"
    }
}

function UnitTest-Assert-IsTrue-True {
    Assert-IsTrue -Actual $true -Message "Must not fail"
}

function UnitTest-Assert-IsTrue-False {
    Assert-Exception {
        Assert-IsTrue -Actual $false -Message "Must fail"
    }
}

function UnitTest-Assert-IsFalse-False {
    Assert-IsFalse -Actual $false -Message "Must not fail"
}

function UnitTest-Assert-IsFalse-True {
    Assert-Exception {
        Assert-IsFalse -Actual $true -Message "Must fail"
    }
}

function UnitTest-Assert-IsNull-Null {
    Assert-IsNull -Actual $null -Message "Must not fail"
}

function UnitTest-Assert-IsNull-NotNull {
    Assert-Exception {
        Assert-IsNull -Actual $false -Message "Must fail"
    }
}

function UnitTest-Assert-IsNotNull-Null {
    Assert-Exception {
        Assert-IsNotNull -Actual $null -Message "Must fail"
    }
}

function UnitTest-Assert-IsNotNull-NotNull {
    Assert-IsNotNull -Actual $false -Message "Must not fail"
}

function UnitTest-Assert-IsEmpty-Empty {
    Assert-IsEmpty -Actual @( ) -Message "Must not fail"
}

function UnitTest-Assert-IsEmpty-Null {
    Assert-IsEmpty -Actual $null -Message "Must not fail"
}

function UnitTest-Assert-IsEmpty-NotEmpty {
    Assert-Exception {
        Assert-IsEmpty -Actual @( $true ) -Message "Must fail"
    }
}

function UnitTest-Assert-IsNotEmpty-Empty {
    Assert-Exception {
        Assert-IsNotEmpty -Actual @( ) -Message "Must fail"
    }
}

function UnitTest-Assert-IsNotEmpty-Null {
    Assert-Exception {
        Assert-IsNotEmpty -Actual $null -Message "Must fail"
    }
}

function UnitTest-Assert-IsNotEmpty-NotEmpty {
    Assert-IsNotEmpty -Actual @( $true ) -Message "Must not fail"
}

function UnitTest-Assert-AreEqual-False {
    Assert-Exception {
        Assert-AreEqual -Expected $true -Actual $false -Message "Must fail"
    }
}

function UnitTest-Assert-AreEqual-True {
    Assert-AreEqual -Expected $true -Actual $true -Message "Must not fail"
}

function UnitTest-Assert-AreNotEqual-False {
    Assert-Exception {
        Assert-AreNotEqual -NotExpected $true -Actual $true -Message "Must fail"
    }
}

function UnitTest-Assert-AreNotEqual-True {
    Assert-AreNotEqual -NotExpected $true -Actual $false -Message "Must not fail"
}

function UnitTest-Assert-Exception-Catches {
    Assert-Exception {
        throw "MockTestFailure" 
    }
}

function UnitTest-Assert-Exception-Fails {
    Assert-Exception {
        Assert-Exception -Script { }
    }
}
